<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>所有的评论</title>
    <%- include conmon %>
</head>

<body>
    <%- include('header',{title:'allcomment'}) %>

    <!-- flage:true  渲染该电影的所有评论 -->
    <% if(flage){  %>
    <div class="container">
        <div class="row">
            <div class="col-md-6 col-sm-6 col-lg-6 text-center">
                <h3 class="text-success "> <%- result[0].mtitle %> </h3>
                <img src="<%- result[0].mpic.replace(/img7/,'img3') %>" height="400" alt="">
            </div>
            <div class="col-md-6 ">
                <h3 class="text-danger text-center"> 电影评论名单 </h3>
                <%   result.forEach((item,index)=>{  %>
                <div>
                    <h4 class="text-info">用户：<%- item.username %></h4>
                    <p class="text-success">评论内容：<%- item.content %></p>
                    <p class="text-default">评论时间： <%- item.time %></p>
                </div>
                <%   })   %>
            </div>
        </div>
    </div>
    <!-- flage:true  渲染该用户的所有评论 -->
    <%  }else{    %>
    <div class="container">
        <h2 text-danger>(用户：<%- result[0].username  %>) 的评论记录</h2>
        <div class="row">
            <table class=" table table-bordered table-hover">
                <tr class="text-center text-primary">
                    <td>序号</td>
                    <td>电影标题</td>
                    <td>电影</td>
                    <td>评论标题</td>
                    <td>评论内容</td>
                    <td>时间</td>
                </tr>
                <%   result.forEach((item,index)=>{  %>
                <tr class="text-center text-default">
                    <td><%- index+1 %></td>
                    <td> <%- item.mtitle %> </td>
                    <td><img style="width: 80px;height: 80px;"
                            src=" <%- item.mpic && item.mpic.replace(/img7/,'img3') %> " alt=""></td>
                    <td><%- item.title %></td>
                    <td><%- item.content %></td>
                    <td><%- item.time %></td>
                </tr>
               <%   })   %>
            </table>
        </div>
    </div>
    <%  }  %>


    <%- include footer %>
</body>

</html>